home *** CD-ROM | disk | FTP | other *** search
- import java.io.File;
- import java.util.ResourceBundle;
-
- public class PageGenerator {
- public static void main(String[] var0) {
- if (var0.length < 1) {
- printUsage();
- }
-
- String var1 = var0[0];
- String var2 = "";
- int var3 = 0;
- String var4 = "";
- String var5 = "";
- if (var0.length >= 2) {
- var2 = var0[1];
- }
-
- try {
- if (var0.length >= 3) {
- var3 = Integer.parseInt(var0[2]);
- }
- } catch (NumberFormatException var11) {
- ResourceBundle var6 = ResourceBundle.getBundle("PageGenerator");
- System.err.println(var6.getString("error") + var6.getString("specifyNumber4skipFolder"));
- printUsage();
- }
-
- if (var0.length >= 4) {
- var4 = var0[3];
- }
-
- if (var0.length >= 5) {
- var5 = var0[4];
- }
-
- if (var2.length() > 0) {
- if (var2.charAt(0) == '"' && var2.charAt(var2.length() - 1) == '"' && var2.length() > 3) {
- var2 = var2 + var2.substring(1, var2.length() - 2);
- }
-
- if (var2.charAt(var2.length() - 1) != File.separatorChar) {
- var2 = var2 + File.separatorChar;
- }
- }
-
- if (var4.length() > 0) {
- System.getProperties().put("proxySet", "true");
- System.getProperties().put("proxyHost", var4);
- if (var5.length() > 0) {
- System.getProperties().put("proxyPort", var5);
- }
- }
-
- int var12 = 0;
-
- try {
- UrlList var7 = new UrlList();
- var7.readFile(var1, var3);
- UrlReplaceDownload var8 = new UrlReplaceDownload(var2);
- var12 = var8.replaceDownload(var7);
- ResourceBundle var9 = ResourceBundle.getBundle("PageGenerator");
- print(var12 + var9.getString("filesDownloaded"));
- } catch (Exception var10) {
- ((Throwable)var10).printStackTrace();
- }
-
- System.exit(var12);
- }
-
- static void print(String var0) {
- System.out.println(var0);
- }
-
- static void printUsage() {
- ResourceBundle var0 = ResourceBundle.getBundle("PageGenerator");
- print(var0.getString("usage"));
- System.exit(-1);
- }
- }
-